import Vue from 'vue'
import App from './App.vue'
import Router from 'vue-router'
import router from './router'
import store from '@/store'
import typeNav from './components/TypeNav'
import header from './components/Header'
import footer from './components/Footer'
import Carousel from './components/Carousel'
import Pagination from './components/Pagination'

import 'element-ui/lib/theme-chalk/index.css';
import {Button, MessageBox, } from 'element-ui';

import '@/mock/mockServe'
import 'swiper/css/swiper.css'
import * as API from '@/api';

import VueLazyload from 'vue-lazyload'

// import validate from '@/plugins/validate';

Vue.component('Header', header);
Vue.component('TypeNav', typeNav);
Vue.component('Footer', footer);
Vue.component('Carousel', Carousel);
Vue.component('Pagination', Pagination);

Vue.component(Button.name, Button);

Vue.config.productionTip = false
Vue.use(Router)
Vue.use(VueLazyload, {
  loading: './assets/logo.png'
})
// Vue.use(validate)

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;


new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  }
}).$mount('#app')
